﻿
@{
    ViewBag.Title = "ProductTypeView";
    Layout = "~/Areas/AdminInfo/Views/Shared/_LayoutPage1.cshtml";
}


<div class="container-fluid larry-wrapper">
    <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12">
            <!--头部搜索-->
            <!--列表-->
            <section class="panel panel-padding">
                <div class="group-button">

                    <button class="layui-btn layui-btn-small modal-iframe" data-params='{"content": "/AdminInfo/AdminSystem/ProductTypeAdd?AddParent=1","full":"true", "title": "添加分类"}'>
                        <i class="iconfont">&#xe649;</i> 添加父级
                    </button>
                    <button class="layui-btn layui-btn-small modal-iframe" data-params='{"content": "/AdminInfo/AdminSystem/ProductTypeAdd?AddChild=1","full":"true", "title": "添加分类"}'>
                        <i class="iconfont">&#xe649;</i> 添加子级
                    </button>
                    <button class="layui-btn layui-btn-small layui-btn-danger ajax-all" data-name="checkbox" data-params='{"url": "/AdminInfo/AdminSystem/ProductTypeDel","data":"","confirm":"true","title":"删除该分类。所关联数据都会失效，您确定"}'>
                        <i class="iconfont">&#xe626;</i> 删除
                    </button>
                </div>
                <div id="list" class="layui-form"></div>
                <div class="text-right" id="page"></div>
            </section>
        </div>
    </div>
</div>
<script>
    layui.use('list');
    function closeall() {
        layer.closeAll();
        window.location.reload();
    }
</script>
<script id="list-tpl" type="text/html" data-params='{"url":"/AdminInfo/AdminSystem/ProductTypeList","pageid":"#page","dataName":"data","tableWidth":"2200px"}'>
    <table id="example" class="layui-table lay-even" lay-even="" data-name="articleData" data-tplid="list-tpl">
        <thead>
            <tr>
                <th width="30"><input type="checkbox" id="checkall" data-name="checkbox" lay-filter="check" lay-skin="primary"></th>
                <th>序号</th>
                <th>上级分类</th>
                <th>分类</th>
                <th>排序</th>
                <th>是否显示首页栏</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {{# layui.each(d.list, function(index, item){ }}
            <tr>
                <td><input type="checkbox" name="checkbox" value="{{ item.TypeID}}" la lay-skin="primary"></td>
                <td>{{ index+1 }}</td>
                <td>{{ item.ParamName}}</td>
                <td>{{ item.Name}}</td>
                <td><input type="text" class="layui-input sort ajax-blur" name="order" value="{{ item.Sorting}}" data-params='{"url":"/AdminInfo/AdminSystem/ProductTypeSortingUp","data":"ID={{ item.TypeID}}"}'> </td>
                <td>
                    {{# if(item.ParamID==0){}}
                    <input type="checkbox" name="switch" lay-skin="switch" lay-text="ON|OFF" {{#if ( parseInt(item.IsShow)){ }} checked="checked" {{# } }} lay-filter="ajax" value="1" data-params='{"url":"/AdminInfo/AdminSystem/ProductIsShow","data":"id={{ item.TypeID}}"}'> 
                    {{# } }}
                </td>
                <td>
                    <div class="layui-btn-group">
                        <button class="layui-btn layui-btn-mini modal-iframe" data-params='{"content": "/AdminInfo/AdminSystem/ProductTypeAdd?Parent={{item.ParamID}}&ID={{item.TypeID}}", "title": "编辑{{item.Name}}分类","full":"true"}'>
                            <i class="iconfont">&#xe653;</i>编辑
                        </button>
                        <button class="layui-btn layui-btn-mini layui-btn-danger ajax" data-list='{"key":"id={{ item.TypeID}}","msg":true,"render":"true","action":"del"}' data-params='{"url": "/AdminInfo/AdminSystem/ProductTypeDel","data":"checkbox={{ item.TypeID}}&name=ni","confirm":"true","title":"删除该分类。所关联数据都会失效，您确定"}'>
                            <i class="iconfont">&#xe626;</i>删除
                        </button>
                    </div>
                </td>
            </tr>
            {{# }); }}
        </tbody>
    </table>
</script>
